package com.hzw.saas.service.property.enums;

public enum ModuleEnum {
    WECHAT_WEBSITE_SAAS("05010101","wechat.website.saas"),
    WECHAT_PHONE_HBOX("05010201","wechat.phone.hbox");
    private String code;
    private String data;

    ModuleEnum(String code, String data) {
        this.code = code;
        this.data = data;
    }

    public String getCode() {
        return code;
    }

    public String getData() {
        return data;
    }

    public static String getDataByCode(String code){
        if (code == null||"".equals(code)){
            return "";
        }
        String byCode = getByCode(code);
        return byCode;
    }


    public static String getByCode(String code) {

        for (ModuleEnum enumList : values()) {

            if (enumList.getCode().equals(code)) {

                return enumList.getData();

            }

        }
        return "";

    }

}
